/////////////////////////////////////////////////////////////////// Programm einrichten //////////////////////////////////////////////////////////////////////// unsigned int Startauslenkung = 90; // Wert 128 entspricht 90° (zwischen 0 und 128) int Positionen[] = {0,15,30,45,60,75,90,100,110,120,130,145,160,175}; // Positionen (Steps ausgehend von Startauslenkung mit Komma getrennt eingeben, Werte müssen >= sein und immer größer werden, Maximalauslenkung=Startauslenkung-größte Position muss kleiner als 128 sein!) int FpU = 32; // Fotos pro Umdrehung (mindestens 1) int ZpF = 3000; // Zeit je Foto (mindestens 100ms) /////////////////////////////////////////////////////////////////// Grundeinstellungen (sollten nicht verändert werden) ///////////////////////////////////////// // MotorA = Turntable // MotorB = Rotator int LEDPin = 13; // choose the pin for the LED int ButtonPin = 11; // choose the input pin (for a pushbutton) int TransPin = 10; const int MotorAPin1 = 6; // Blue - In 1 const int MotorAPin2 = 7; // Pink - In 2 const int MotorAPin3 = 8; // Yellow - In 3 const int MotorAPin4 = 9; // Orange - In 4 const int MotorBPin1 = 2; // Blue - In 1 const int MotorBPin2 = 3; // Pink - In 2 const int MotorBPin3 = 4; // Yellow - In 3 const int MotorBPin4 = 5; // Orange - In 4 int senkrechteSchritte = 15; // Senkrechte Auflösung (Steps zwischen Turntable-Ebenen (128 entspricht 90°), wenn der Abstand zwischen den "Turntable-Ebenen" zu groß ist) int MotorBSpeed = 4000; // Wartezeit in ms (1000128) or Startauslenkung>128){t =1;} for (int i=0;is){s = Positionen[i];}} if (t == 1){digitalWrite(LEDPin, HIGH);for (int i=1;i>0;i+=1){i=1;}} } void loop(){ aktuellePosition= 0; MotorAstop(); MotorBstop(); do { //Warteschleife für Knopfdruck zum starten val = digitalRead(ButtonPin); digitalWrite(LEDPin, HIGH); delay(50); digitalWrite(LEDPin, LOW); delay(50); } while (val == LOW); MotorBlinks(Startauslenkung); // Startposition for (int i=0;iPositionen[0])){ t = 0; Ausloesen(ZpF);} aktuellePosition+=1;} t = 0; for (int j=0;jStartauslenkung){ MotorBlinks(aktuellePosition-Startauslenkung);} //Endposition einnehmen if (aktuellePosition+1